#version 460

layout(location = 0) in vec4 vColor;
layout(location = 1) in vec2 vUV;
layout(location = 2) in flat float gap;
layout(location = 3) in flat float offset;
layout(location = 4) in flat uint shaderType;
layout(location = 5) in float shaderBlur;
layout(location = 6) in float shaderShadow;
layout(location = 7) in vec2 vScreenPos;


layout(location = 0) out vec4 outColor;
layout(location = 1) out vec4 outColorB;
//layout(depth_greater) out float gl_FragDepth;

void main(void){
	float dist = distance(gl_FragCoord.xy, vScreenPos);
	float alpha = smoothstep(1.0, 0.5, dist);


	outColor = vColor;
	//outColor = vec4(1);
	//outColor.a *= alpha;
	//outColor = vec4(vec3(alpha), 1);
	//outColor = vec4(1,1,0,1);
	//outColor.a = -outColor.a;
	/*switch(shaderType & 63){
		case DEF_2DShaderType_Stripe: {
			uint k = uint( (vUV.y + offset) / gap);
			float a = fract((floor((vUV.y - offset) / gap)) / 2) * 2;
			
			outColor = mix(vColor, vColor * 0.9, a);
			break;
		}
		case DEF_2DShaderType_Checkerboard: {
			vec2 uv = floor(gl_FragCoord.xy / gap);
			outColor = mod(uv.x + uv.y, 2.0) * vec4(vColor);
			break;
		}
		default :{
			outColor = vColor;
		}
	}*/

	
	outColorB.r = shaderBlur;
	outColorB.g = shaderShadow;
	outColorB.b = 0;
	outColorB.a = outColor.a;
}



 